
if(typeof(_e) == "undefined") {
_e = {}
}

/*e
event handle
_e.bind("#a","click",function(){alert(this.id)})
d = document.querySelector("#d")
_e.bindAll(".b","click",function(){alert("ok")},d)
*/

_e["bind"] = function(selectors,ev,func,dom,flag){
  var el
  if(arguments.length==3){
    el = document.querySelector(selectors)

  }
  if(arguments.length>3){
    el = dom.querySelector(selectors)

  }
  var b = false
  if(arguments.length==5){
    b = flag
  }
  if(el) el.addEventListener(ev,func,b)



}

_e["bindAll"] = function(selectors,ev,func,dom,flag){
  var els
  if(arguments.length==3){
    els = document.querySelector(selectors)

  }
  if(arguments.length>3){
    els = dom.querySelectorAll(selectors)

  }
  var b = false
  if(arguments.length==5){
    b = flag
  }
  alert(els.length)
  if(els) {
    for(var i=0; i<els.length;i++)
    els[i].addEventListener(ev,func,b)
  }

}
_e["getSelectedOption"] = function(sel){

}
